using Assets.Scripts.GDK;
using UnityEngine;

namespace Brick
{
	public class MuzzuleBoxModule : gdk_base_Imodule
	{
		private bool isTouch;

		public bool isEndMove = true;

		private bool isCanShoot = true;

		public void SetCanShoot(bool bShoot)
		{
			isCanShoot = bShoot;
		}

		public void touchStart(GameObject gameObject)
		{
			if (isCanShoot)
			{
				isTouch = true;
			}
		}

		public void touchMove(GameObject gameObject)
		{
			if (isTouch)
			{
				UnityEngine.Debug.Log("touchMove");
			}
		}

		public void touchEnd(GameObject gameObject)
		{
			if (isTouch)
			{
				UnityEngine.Debug.Log("touchEnd");
				isTouch = false;
			}
		}

		public void touchCancel(GameObject gameObject)
		{
			if (isTouch)
			{
				isTouch = false;
				UnityEngine.Debug.Log("touchCancel");
				shootingOut();
			}
		}

		public void touchMove(Vector2 toPos)
		{
			if (isTouch)
			{
				gdk_game_manager.DispachEvent(EventID.GAME_SHOOT_MOVE, toPos);
			}
		}

		private void hideSelectLine()
		{
			gdk_game_manager.DispachEvent(EventID.GAME_SHOOT_CANCLE);
		}

		private void shootingOut()
		{
			gdk_game_manager.DispachEvent(EventID.GAME_SHOOT_OUT);
		}
	}
}

